﻿using BullsAndCows;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using BullsAndCows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wintellect.PowerCollections;

namespace BullsAndCowsTests
{
    
    
    /// <summary>
    ///This is a test class for ProgramTest and is intended
    ///to contain all ProgramTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ProgramTest
    {



        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Help
        ///</summary>
        [TestMethod()]
        [DeploymentItem("BullsAndCows.exe")]
        public void HelpTest()
        {
        }

        /// <summary>
        ///A test for IsXExist
        ///</summary>
        [TestMethod()]
        [DeploymentItem("BullsAndCows.exe")]
        public void IsXExistTest()
        {
          StringBuilder reveals=new StringBuilder("7x77");
          bool p=Program.IsXExist(reveals);
          Assert.AreEqual(p,true);
        }

        [TestMethod()]
        [DeploymentItem("BullsAndCows.exe")]
        public void IsXExistTestNo()
        {
            StringBuilder reveals = new StringBuilder("7477");
            bool p = Program.IsXExist(reveals);
            Assert.AreEqual(p, false);
        }

        /// <summary>
        ///A test for Main
        ///</summary>
        [TestMethod()]
        [DeploymentItem("BullsAndCows.exe")]
        public void MainTest()
        {

        }

        /// <summary>
        ///A test for PrintTop
        ///</summary>
        [TestMethod()]
        [DeploymentItem("BullsAndCows.exe")]
        public void PrintTopTest()
        {

        }

        /// <summary>
        ///A test for Restart
        ///</summary>
        [TestMethod()]
        [DeploymentItem("BullsAndCows.exe")]
        public void RestartTest()
        {
            int oldNumber = Program.randomObj.Next(10000);
            Program.usedHelp = false;
            Program.Restart();
            Assert.AreNotEqual(Program.secredNumber, oldNumber);
        }

    }
}
